/*
 * @Author: 大D
 * @email: 857216393@qq.com
 * @Date: 2023-12-25 17:12:16
 * @Description: 扩展定义axios 请求参数类型
 * @params cancel 取消重复请求 默认true
 *         showLoading 展示loading 默认true
 */

import type { AxiosRequestConfig, InternalAxiosRequestConfig, AxiosResponse } from 'axios';

export interface IAxiosRequestConfig extends AxiosRequestConfig {
  cancel?: boolean;
  showLoading?: boolean;
  interceptors?: Iinterceptors;
}

export interface Iinterceptors {
  request?: (config: InternalAxiosRequestConfig) => InternalAxiosRequestConfig;
  requestCatch?: (error: any) => Promise<any>;
  response?: <T = AxiosResponse>(res: T) => T;
  responseCatch?: (error: any) => Promise<any>;
}
